<template>
    <div>
        <div>{{ name }}</div>
        <div>{{ age }}</div>
        <el-button @click="handleClick">child2</el-button>
    </div>
</template>
    
<script setup lang='ts'>
import { ref } from 'vue'

const props = defineProps({
    name: String,
    age: Number
})

const childData = ref({
    name: '1'
});
const childEvent = () => {
    childData.value.name = '11111111111111'
    console.log(childData.value.name)
}
defineExpose({
    childEvent
})

const emit = defineEmits(['submit']);

const handleClick = () => {
    console.log(props.age, 'props')
    emit('submit', (props.age || 0) + 100)
}

</script>
    